package com.ny.service.impl;

import com.ny.entity.Reservations;
import com.ny.mapper.ReservationMapper;
import com.ny.service.ReservationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ReservationServiceImpl implements ReservationService {
    @Autowired
    private ReservationMapper reservationMapper;


    @Override
    public void addReservation(Reservations reservation) {
        reservationMapper.addReservation(reservation);
    }

    //该服务实现类实现了 `findAllReservations` 方法，调用 `reservationMapper.findAllReservations()` 进行数据库查询操作。
    @Override
    public List<Reservations> findAllReservations() {
        return reservationMapper.findAllReservations();
    }




//该服务实现类实现了 `updateReservationStatus` 方法，
//调用 `reservationMapper.updateReservationStatus(reservationId, status, rejectReason)` 进行数据库更新操作。
    @Override
   public void updateReservationStatus(int reservationId, String status, String rejectReason) {
        reservationMapper.updateReservationStatus(reservationId,status,rejectReason);
    }
}


//        @Override
////该服务实现类实现了 `addReservation` 方法，
////调用 `reservationMapper.addReservation(reservation)` 进行数据库插入操作(预约服务)
//        public void addReservation(Reservations reservation) {
//            reservationMapper.addReservation(reservation);
//        }
//
//

//
//


////该服务实现类实现了 `findAllReservations` 方法，
//// 调用 `reservationMapper.findAllReservations()` 进行数据库查询操作。
//
//    @Override
//    public int getReservationById(int reservationId) {
//        return reservationMapper.getClassroomIdByReservationId(reservationId);
//    }



